/*
 * @FileName: bsp_can.h
 * @Author: GreyQiu qiushaogui@aikosolar.com
 * @Date: 2023-08-21 10:50:15
 * @LastEditors: GreyQiu qiushaogui@aikosolar.com
 * @LastEditTime: 2023-08-21 16:53:25
 * @Description: 
 * 
 * Copyright (c) 2023, All Rights Reserved. 
 */

#ifndef __BSP_CAN_H__
#define __BSP_CAN_H__

#include "driverlib.h"
#include "stddef.h"

#define CAN_BASE     CANA_BASE

#define CAN_BAUDRATE   (500000)
#define CAN_BIT_TIME   (20)

#define GPIO_CFG_CANTXA      GPIO_2_CANA_TX  // "pinConfig" for CANA TX
#define GPIO_CFG_CANRXA      GPIO_3_CANA_RX  // "pinConfig" for CANA RX

typedef void (*can_rxc_calllback)(uint8_t * rx_buffer, uint32_t len);

void bsp_can_init(void);
void bsp_can_send(uint8_t * buffer, uint32_t len);
void bsp_can_callback_register(can_rxc_calllback cb);

#endif
